import request from '@/utils/request'

// 查询文章信息列表
export function listNews(query) {
    return request({
        url: '/operater/news/list',
        method: 'get',
        params: query
    })
}

// 查询文章信息详细
export function getNews(id) {
    return request({
        url: '/operater/news/' + id,
        method: 'get'
    })
}

// 新增文章信息
export function addNews(data) {
    return request({
        url: '/operater/news',
        method: 'post',
        data: data
    })
}

// 修改文章信息
export function updateNews(data) {
    return request({
        url: `/operater/news`,
        method: 'put',
        data: data
    })
}
// 修改文章状态
export function updateState(data) {
    return request({
        url: `/operater/news/examine?id=${data.id}&newsRemarks=${data.newsRemarks}&yesOrNo=${data.yesOrNo}`,
        method: 'put'
    })
}

// 删除文章信息
export function delNews(id) {
    return request({
        url: '/operater/news/' + id,
        method: 'delete'
    })
}

// 导出文章信息
export function exportNews(query) {
    return request({
        url: '/operater/news/export',
        method: 'get',
        params: query
    })
}